package com.warmheart.base.model;

import com.warmheart.base.entity.BaseEntity;
import com.warmheart.core.co.base.BaseCoBuilder;
import com.warmheart.core.co.builder.CoBuilder;
import com.warmheart.core.cors.builder.CoRsBuilder;
import com.warmheart.core.rs.base.BaseRsBuilder;
import com.warmheart.core.rs.builder.RsBuilder;

/**
 * 
 * @ClassName: EntityModel
 * @Description: 通用实体类，主要用于自定义查询参数处理，之所以单独写出是为了保持调用的一致性
 * @author ZhangJianyang
 * @date 2025-06-16 09:37:02
 *
 */
public class EntityModel extends BaseEntity<BaseCoBuilder<?, ?>, BaseRsBuilder<?, ?>> {

    private static final long serialVersionUID = 1L;
    
    @Override
    public String tableName() {
        return null;
    }

    @Override
    public BaseCoBuilder<?, ?> coBuilder() {
        CoRsBuilder<?, ?> t = this;
        return new BaseCoBuilder<CoRsBuilder<?, ?>, CoBuilder<CoRsBuilder<?, ?>>>() {

            @Override
            public CoRsBuilder<?, ?> core() {
                return t;
            }

            @Override
            protected CoBuilder<CoRsBuilder<?, ?>> self() {
                return this;
            }
        };
    }

    @Override
    public BaseRsBuilder<?, ?> rsBuilder() {
        CoRsBuilder<?, ?> t = this;
        return new BaseRsBuilder<CoRsBuilder<?, ?>, RsBuilder<CoRsBuilder<?, ?>>>() {

            @Override
            public CoRsBuilder<?, ?> core() {
                return t;
            }

            @Override
            protected RsBuilder<CoRsBuilder<?, ?>> self() {
                return this;
            }
        };
    }

}
